<template>
       <!-- 活动详情 -->
       <div>
        <el-scrollbar height="calc(60vh)">
            <el-card style="max-width: 100%">
                <el-form :model="formData" label-width="auto" style="max-width: 600px" ref="formRef">
                    <el-form-item label="负责人" prop="ownerId">
                        <el-input v-model="formData.ownerName"  disabled />
                    </el-form-item>
                    <el-form-item label="所属活动" prop="activityId">
                        <el-input v-model="formData.activityName"  disabled />
                    </el-form-item>
                    <el-form-item label="姓名" prop="fullName">
                        <el-input v-model="formData.fullName"  disabled />
                    </el-form-item>
                    <el-form-item label="称呼" prop="appellation">
                        <el-input v-model="formData.appellationValue"  disabled />
                    </el-form-item>
                    <el-form-item label="手机" prop="phone">
                        <el-input v-model="formData.phone"  disabled/>
                    </el-form-item>
                    <el-form-item label="微信" prop="weixin">
                        <el-input v-model="formData.weixin"  disabled />
                    </el-form-item>
                    <el-form-item label="QQ" prop="qq">
                        <el-input v-model="formData.qq"  disabled />
                    </el-form-item>
                    <el-form-item label="邮箱" prop="email">
                        <el-input v-model="formData.email"  disabled />
                    </el-form-item>
                    <el-form-item label="年龄" prop="age">
                        <el-input v-model="formData.age"  disabled />
                    </el-form-item>
                    <el-form-item label="职业" prop="job">
                        <el-input v-model="formData.job"  disabled />
                    </el-form-item>
                    <el-form-item label="年收入" prop="yearIncome">
                        <el-input v-model="formData.yearIncome"  disabled />
                    </el-form-item>
                    <el-form-item label="住址" prop="address">
                        <el-input v-model="formData.address"  disabled />
                    </el-form-item>
                    <el-form-item label="贷款" prop="needLoan">
                        <el-input v-model="formData.needLoanValue"  disabled />
                    </el-form-item>
                    <el-form-item label="意向状态" prop="intentionState">
                        <el-input v-model="formData.intentionStateValue"  disabled />
                    </el-form-item>
                    <el-form-item label="意向产品" prop="intentionProduct">
                        <el-input v-model="formData.intentionProductValue"  disabled />
                    </el-form-item>
                    <el-form-item label="线索状态" prop="state">
                        <el-input v-model="formData.stateValue"  disabled />
                    </el-form-item>
                    <el-form-item label="线索来源" prop="source">
                        <el-input v-model="formData.sourceValue"  disabled />
                    </el-form-item>
                    <el-form-item label="线索描述" prop="description">
                    <el-input v-model="formData.description" disabled type="textarea"/>
                    </el-form-item>
                    <el-form-item label="下次联系时间" prop="nextContactTime">
                        <el-date-picker
                            v-model="formData.nextContactTime"
                            type="date"
                            placeholder="请选择时间"
                            format="YYYY-MM-DD HH:mm:ss"
                            value-format="YYYY-MM-DD HH:mm:ss"
                            disabled
                        />
                    </el-form-item>
                </el-form>
                <el-button type="info" @click="router.go(-1)" plain>返回</el-button>
            </el-card>
        </el-scrollbar>
    </div>
</template>
<script lang="ts" setup name="CustomerView">
import { useRoute } from 'vue-router';
import router from '@/router';
import { ref,reactive,onMounted } from 'vue';
import { baseService } from '@/utils/httpReqest';
import { ElMessage } from 'element-plus';
import { Clue } from '@/hooks/clue';
let route = useRoute();
let customerId = route.params.id
let formData = reactive<Clue>(new Clue());
let customerInfo = () => {
    baseService.doGet(`/customer/info/${customerId}`)
        .then((res: any) => {
            if (res.code == 200) {
                for (const key in formData) {
                    formData[key as keyof Clue] = res.data[key]
                }
            } else {
                ElMessage.error("该客户信息不存在")
            }
        })
}
onMounted(() => {
    customerInfo();
})
</script>
<style scoped>

</style>